/**
 * 表单重置函数
 * @param form  表单数据
 */
export const resetForm = (form: Record<string, any>, newForm?: Record<string, any>) => {
    for (const key in form) {
        if (Object.prototype.hasOwnProperty.call(form, key)) {
            if (key) {
                continue
            }
            if (newForm) {
                form[key] = newForm[key] ?? undefined
                continue
            }
            form[key] = undefined
        }
    }
}
/**
 * 将查询表单的数据中的value重置为undefined
 * @param form 查询表单数据
 */
export const resetQueryForm = (form: any[]) => {
    form.forEach((item) => {
        if (item.value !== undefined) {
            item.value = undefined
        }
    })
}
